﻿using DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{

    public class PersonServiceImpl
    {
        private PersonDao personDao = new PersonDao();
        public List<Person> list(Person employee)
        {
            if (employee.IsDel != null && employee.IsDel != "")
            {
                employee.IsDel = "在职".Equals(employee.IsDel) ? "0" : "1";
            }
            return personDao.list(employee);
        }

        public bool save(Person person)
        {
            return personDao.save(person) > 0;
        }

        public string getMaxId()
        {
            return personDao.getMaxId();
        }

        public int deleteById(string id)
        {
            return personDao.deleteById(id);
        }

        public bool updateById(Person person)
        {
            return personDao.updateById(person) > 0;
        }
    }
}
